import fetch from "@/utils/fetch"

    
export function getParentmenu(pagelist){
    console.log(pagelist);
    return fetch({
        url:'priFuncs/menu/page?pageNum='+pagelist.pageNum+"&pageSize="+pagelist.pageSize,
        method:'get',
        // data:JSON.stringify(result)
     })
 }

 export function getAllmenu(){
    return fetch({
        url:'priFuncs/',
        method:'get',
    })
}
export function addMenu(result){
    console.log(result);
     return fetch({
         url:'priFuncs/',
         method:'post',
         headers: {'content-type': 'application/json;charset=UTF-8'},
         data:JSON.stringify(result)
        
     })
}
export function updateMenu(result){
     return fetch({
         url:'priFuncs/'+result.id,
         method:'put',
         headers: {'content-type': 'application/json;charset=UTF-8'},
         data:JSON.stringify(result.privilegeFunction)
     })
}
export function deleteMenu(result){
    return fetch({
        url:'priFuncs/'+result,
        method:'delete',
        headers: {'content-type': 'application/json;charset=UTF-8'},
       
    })
}
 export function getOnemenu(result){
    return fetch({
        url:'priFuncs/'+result,
        method:'get',
    })
}